\(\int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\) [118]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 26 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {i}{d \left (a^2+i a^2 \tan (c+d x)\right )} \]

[Out]

I/d/(a^2+I*a^2*tan(d*x+c))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 32} \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {i}{d \left (a^2+i a^2 \tan (c+d x)\right )} \]

[In]

Int[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x])^2,x]

[Out]

I/(d*(a^2 + I*a^2*Tan[c + d*x]))

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \text {Subst}\left (\int \frac {1}{(a+x)^2} \, dx,x,i a \tan (c+d x)\right )}{a d} \\ & = \frac {i}{d \left (a^2+i a^2 \tan (c+d x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.73 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {1}{a^2 d (-i+\tan (c+d x))} \]

[In]

Integrate[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x])^2,x]

[Out]

1/(a^2*d*(-I + Tan[c + d*x]))

Maple [A] (verified)

Time = 1.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.73

method result size
derivativedivides \(\frac {1}{a^{2} d \left (\tan \left (d x +c \right )-i\right )}\) \(19\)
default \(\frac {1}{a^{2} d \left (\tan \left (d x +c \right )-i\right )}\) \(19\)
risch \(\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{2 a^{2} d}\) \(19\)

[In]

int(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/a^2/d/(tan(d*x+c)-I)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {i \, e^{\left (-2 i \, d x - 2 i \, c\right )}}{2 \, a^{2} d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/2*I*e^(-2*I*d*x - 2*I*c)/(a^2*d)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (17) = 34\).

Time = 0.51 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.50 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\begin {cases} - \frac {i \sec ^{2}{\left (c + d x \right )}}{2 a^{2} d \tan ^{2}{\left (c + d x \right )} - 4 i a^{2} d \tan {\left (c + d x \right )} - 2 a^{2} d} & \text {for}\: d \neq 0 \\\frac {x \sec ^{2}{\left (c \right )}}{\left (i a \tan {\left (c \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \]

[In]

integrate(sec(d*x+c)**2/(a+I*a*tan(d*x+c))**2,x)

[Out]

Piecewise((-I*sec(c + d*x)**2/(2*a**2*d*tan(c + d*x)**2 - 4*I*a**2*d*tan(c + d*x) - 2*a**2*d), Ne(d, 0)), (x*s
ec(c)**2/(I*a*tan(c) + a)**2, True))

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.81 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {i}{{\left (i \, a \tan \left (d x + c\right ) + a\right )} a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

I/((I*a*tan(d*x + c) + a)*a*d)

Giac [A] (verification not implemented)

none

Time = 0.46 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.15 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=-\frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2} d {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{2}} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-2*tan(1/2*d*x + 1/2*c)/(a^2*d*(tan(1/2*d*x + 1/2*c) - I)^2)

Mupad [B] (verification not implemented)

Time = 3.89 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.85 \[ \int \frac {\sec ^2(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {1{}\mathrm {i}}{a^2\,d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \]

[In]

int(1/(cos(c + d*x)^2*(a + a*tan(c + d*x)*1i)^2),x)

[Out]

1i/(a^2*d*(tan(c + d*x)*1i + 1))